﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>相关品牌页面</title>
    <link rel="stylesheet" href="../../css/media.css">
    <link rel="stylesheet" href="../../css/font-style.css">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/AllBrand.css">
</head>

<body>
    <!-- 头部 -->
    <header>
        <a href="javascript:;">
            <img src="../../images/header_logo.png" alt="">
        </a>
        <!-- 头部中间文字，看需求 -->
        <!-- <span>头部</span> -->
        <a href="javascript:;">
            <img src="../../images/header_app.png" alt="">
        </a>
    </header>
    <!-- 搜索栏 -->
    <div class="search">
        <input type="text" placeholder="请输入你想比价的商品" class="search_text">
        <a href="javascript:;" class="search_btn">搜索</a>
    </div>

    <!-- 主要内容 -->
    <main>
        <!-- 全部分类 -->
        <div class="classify">
            <a href="../../index.html">首页<span class="icon-arrow-right"></span></a>
            <!-- <a href="#">全部分类<span class="icon-arrow-right"></span></a> -->
        </div>
        <!--热门品牌排行  -->
        <div class="hot_brand">
            <h3 class="hot_brand_title">热门品牌排行</h3>
            <div class="hot_brand_content">
                
            </div>
        </div>
    </main>

   <!-- 底部 -->
    <footer>
        <div class="foot_tool">
            <a href="javascript:;">登录</a>
            <a href="javascript:;">注册</a>
            <a href="javascript:;">返回顶部</a>
        </div>
        <div class="foot_content">
            <a href="javascript:;">手机APP下载
                <span>慢慢买手机版</span>
            </a>
            <span>--掌上比价平台</span>
            <p>m.manmanbuy.com</p>

        </div>
    </footer>
</body>
</html>
<script src="../../lib/zepto/zepto.min.js"></script>
<script src="../../lib/template/template.js"></script>
<script type="text/template" id="navListTmp">
    {{each result as val key}}
        <a href="AboutBrand.html?id={{val.brandTitleId}}&title={{val.brandTitle}}">{{val.brandTitle}}<span class="icon-arrow-right"></span></a>
        <!-- <input type="hidden" value = '{{val.brandTitleId}}'> -->
   {{/each}}
</script>
<script>
  render();
  function render(){
     $.ajax({
      type:'get',
      url:'http://193.112.55.79:9090/api/getbrandtitle',
      dataType:'json',
      success:function (res) {
        console.log(res);
          // 准备模板字符串
          var htmlStr = template('navListTmp',res);
          // 动态渲染数据
          $('.hot_brand_content').html(htmlStr);
      }
    })
  }
</script>
<script type="text/javascript">
    $('.back').on('click',function(){
        window.history.go(-1);
    });
</script>